package com.rd.student.jike.class4.xiayinyin.day0808;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Arrays;
import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        File file = new File("Student.txt");
        Writer writer = new FileWriter(file);
        for (int i = 0; i < 3; i++) {
            String[] arr = entering();
            writer.append(Arrays.toString(arr));
        }
        writer.close();
    }
    public static String[] entering(){
        String[] arr = new String[4];
        System.out.println("请输入姓名");
        Scanner scannerName = new Scanner(System.in);
        arr[0] = scannerName.nextLine();
        System.out.println("请输入语文成绩");
        Scanner scannerChinese = new Scanner(System.in);
        int chinese = scannerChinese.nextInt();
        arr[1] = ""+chinese;
        System.out.println("请输入数学成绩");
        Scanner scannerMath = new Scanner(System.in);
        int math = scannerMath.nextInt();
        arr[2] = ""+math;
        int mun = math+chinese;
        arr[3] = ""+mun;
        return arr;
    }
}
